#include "Sender.h"
#include <stdio.h>

Sender::Sender(const string &ip, unsigned short port)
: _sock()
, _addr(ip, port)
{
}

Sender::~Sender()
{

}

int Sender::sockConnect()
{
    int ret=connect(fd(),(struct sockaddr*)_addr.getInetAddrPtr(),sizeof(*_addr.getInetAddrPtr()));
    if(-1 == ret)
    {
        perror("connect");
        return -1;
    }
    return ret;  
}


int Sender::fd() const
{
    return _sock.fd();
}